/*
** my_atoi.c for minitalk in /home/compilation/minitalk
** 
** Made by christophe labonnemartinez
** Login   <labonn_c@epitech.net>
** 
** Started on  Wed Feb 22 18:22:07 2012 christophe labonnemartinez
** Last update Sat Aug 11 12:35:38 2012 christophe labonnemartinez
*/

#include "includes/my.h"

int	my_atoi(char *str)
{
  int	n;

  if (*str == '-')
    return (-my_atoi(str + 1));
  if (*str == '+')
    return (my_atoi(str + 1));
  n = 0;
  while (*str >= '0' && *str <= '9')
    n = n * 10 + (*(str++) - '0');
  return (n);
}
